#ifndef RP2NODE_H
#define RP2NODE_H

#include "Rp2System.h"
#include "Rp2Spatial.h"
#include "Rp2Culler.h"

namespace Rp2
{

class Node : public Spatial
{
public:
	Node();
	virtual ~Node();

	// children
	int GetQuantity() const;
	int AttachChild(Spatial* pkChild);
	int DetachChild(Spatial* pkChild);
	SpatialPtr GetChild(int i);

protected:
    // geometric updates
    virtual void UpdateWorldData (double dAppTime);
    virtual void UpdateWorldBound ();
	
	// update render state
	virtual void UpdateState(std::vector<GlobalState*>* akGStack, std::vector<Light*>* pkLStack);

    // culling
    virtual void GetVisibleSet (Culler& rkCuller, bool bNoCull);

	std::vector<SpatialPtr> m_kChild;
};

#include "Rp2Node.inl"

typedef Pointer<Node> NodePtr;
}

#endif